/**
 *******************************************************************************
 * @FileName  : heap.h
 * @Author    : GaoQiu
 * @CreateDate: 2020-02-18
 * @Copyright : Copyright(C) GaoQiu
 *              All Rights Reserved.
 *******************************************************************************
 *
 * The information contained herein is confidential and proprietary property of
 * GaoQiu and is available under the terms of Commercial License Agreement
 * between GaoQiu and the licensee in separate contract or the terms described
 * here-in.
 *
 * This heading MUST NOT be removed from this file.
 *
 * Licensees are granted free, non-transferable use of the information in this
 * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
 *
 *******************************************************************************
 */
#ifndef HEAP_H_
#define HEAP_H_

#include "defs_types.h"

#if 0
#ifndef HEAP_MEM_SIZE
	#define HEAP_MEM_SIZE    (2 * 1024 + 200)
#endif


#define HEAP_MEM_DEFINE()  static uint32_t heap[HEAP_MEM_SIZE/sizeof(uint32_t)]
#endif

/**
 * @brief:  Init heap memory.
 * @param:  pMem       Pointer point to memory !!!Note (align to word boundary)
 * @param:  byteSize   the byte size of memory
 * @return: none.
 */
void HeapInit(uint8_t *pMem, uint32_t byteSize);

/**
 * @brief:  Reserve heap memory.
 * @param:  size     Number of bytes of heap memory used.
 * @return: none.
 */
void HeapAlloc(uint32_t size);

/**
 * @brief:  Allocate heap memory.
 * @param:  size     Number of bytes of heap memory used.
 * @return:
 */
void *HeapAllocEx(uint32_t size);

/**
 * @brief : Get heap start address.
 * @param : None.
 * @return: address of the start of heap memory.
 */
void *HeapGetFreeStartAddr(void);

/**
 * @brief: Get heap available.
 * @param : None.
 * @return: Number of heap memory size.
 */
uint32_t HeapGetAvailableSize(void);



#endif /* HEAP_H_ */
